package com.starlink.model.util;

import com.starlink.model.dtomapper.AgreementDtoMapper;
import com.starlink.model.domain.AgreementDO;
import com.starlink.model.vo.AgreementVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class AgreementConvert {

    public static List<AgreementVO> buildAgreementVoList(List<AgreementDO> agreementDOList) {
        if (CollectionUtils.isEmpty(agreementDOList)) {
            return Lists.newArrayList();
        }
        List<AgreementVO> agreementVOList = new ArrayList<>();
        for (AgreementDO agreementDO : agreementDOList) {
            agreementVOList.add(AgreementDtoMapper.INSTANCE.do2VO(agreementDO));
        }

        return agreementVOList;
    }
}
